<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>AJAX</title>
    <script>
function loadXMLDoc()
{
	var xmlhttp;
	if (window.XMLHttpRequest)
	{
		// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		// IE6, IE5 浏览器执行代码
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
		}
		alert("readyState=="+xmlhttp.readyState+", statues=="+xmlhttp.status+","+xmlhttp.toString());
	}
	xmlhttp.open("GET","http://139.199.25.198:6003/AppV1/eqDetect/checkVerAndro?versionNo=1.2",true);
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send();
}
    </script>

    <script type="text/javascript">
        function findid(){
         document.getElementById("myDiv2").innerHTML="123";
        }
    </script>

    <script type="text/javascript">
        function showtable(){
        var i;
        var table=0;
        for (i = 0; i <20; i++) {
        table =table+i+"</br>";
        }
        document.getElementById("myDiv3").innerHTML = table;
        }
    </script>

    <script type="text/javascript">
        function alertt(){
        alert("ajax  asyncronous javascript and xml");
        }
    </script>
</head>
<body>

<h1>Asynchronous JavaScript and XML（异步的 JavaScript 和 XML）。</h1>
<div data-role="main" class="ui-content">
    <button type="button" data-role="main" class="ui-content" onclick="loadXMLDoc()">
        loadXMLDoc请求数据
    </button>
    <button data-role="main" class="ui-content" type="button" onclick="findid()">findid</button>
    <button data-role="main" class="ui-content" type="button" onclick="showtable()">showTable
    </button>
    <div id="dd" data-role="main" class="ui-content">
        <button type="button" onclick="alertt()" style="font-size:40px;color:blue;max-height:60px;max-width:300px"> div-button-click</button>
    </div>
    <div id="myDiv" style="font-size:60px"></div>
    <div id="myDiv2"
         style="color:green ; font-size:40px ; background-color:yellow;max-width:200px"></div>
    <div id="myDiv3"
         style="color:green ; font-size:40px ; background-color:orange;max-width:200px"></div>

</div>
</body>
</html>